/**
 * 布局
 */
$(function() {
	var layout = new Layout();
	layout.init();
});

var Layout = function() {
	function init() {
		/*$('#panel').layout('add', {
			region : 'west',
			width : 180,
			title : 'West Title',
			split : true,
			tools : [ {
				iconCls : 'icon-add',
				handler : function() {
					alert('add');
				}
			}, {
				iconCls : 'icon-remove',
				handler : function() {
					alert('remove');
				}
			} ]
		});*/
		
		$('#aa').accordion({  
		    animate:true  
		});  
	}
	return {
		init: function(){
			init();
			$(window).resize(function(){
				 resize();
			});
			accordionClick();
		},
		itemClick:function(){
			
		}
		
	};
	
	function resize(){
		var panel =  $('#aa');
		var ph = panel.parent().height();
		var pw = panel.parent().width();
		
		panel.height(ph-3);
		panel.width(pw-3);
	}
	
	function accordionClick(){
		var pp = $('#aa').accordion('getSelected'); 
		if (pp){  
		    pp.panel('refresh',ctx+'/login/login.jsp');  // call 'refresh' method to load new content  
		} 
	}
	
};
